import request from '@/utils/request'

export function getDiyPageDefaultData (params:{
    tools_type?:string;
}) {
    return request({
        url: 'store.diyPage/defaultData',
        method: 'GET',
        params
    })
}


export function getDiyLinkList (params:{
    type:string;
    search?:string;
    page?:string | number;
}) {
    return request({
        url: 'store.diyPage/linkList',
        method: 'GET',
        params
    })
}
export function getDiyTempList (params:{
    type:string;
}) {
    return request({
        url: 'store.diyPage/tempList',
        method: 'GET',
        params
    })
}

export function getDiyPageList (params:any) {
    return request({
        url: 'store.diyPage/list',
        method: 'GET',
        params
    })
}

// 添加自定义页面
export function createDiyPage (data:any) {
    return request({
        url: 'store.diyPage/create',
        method: 'POST',
        data
    })
}
export function updateDiyPage (data:any) {
    return request({
        url: `store.diyPage/update`,
        method: 'PUT',
        data
    })
}
export function delDiyPage (data:{id:number|string}) {
    return request({
        url: `store.diyPage/delete`,
        method: 'DELETE',
        data
    })
}
export function selectedDiyPageHome (data:{id:number|string}) {
    return request({
        url: `store.diyPage/setHome`,
        method: 'PUT',
        data
    })
}
export function getDiyPageDetail (params:{id:number|string}) {
    return request({
        url: `store.diyPage/detail`,
        method: 'GET',
        params
    })
}

export function getDiyPageHome () {
    return request({
        url: `store.diyPage/getHome`,
        method: 'GET'
    })
}

export function getDiyNavdesign () {
    return request({
        url: `store.diyPage/getNavdesign`,
        method: 'GET'
    })
}
export function updateDiyNavdesign (data:any) {
    return request({
        url: `store.diyPage/updateNavdesign`,
        method: 'PUT',
        data
    })
}

export function getDiyCategroy () {
    return request({
        url: `store.diyPage/getCategroy`,
        method: 'GET'
    })
}
export function updateDiyCategroy (data:any) {
    return request({
        url: `store.diyPage/updateCategroy`,
        method: 'PUT',
        data
    })
}




export function getDiyTheme () {
    return request({
        url: `store.diyPage/getTheme`,
        method: 'GET'
    })
}
export function updateDiyTheme (data:any) {
    return request({
        url: `store.diyPage/updateTheme`,
        method: 'PUT',
        data
    })
}



export function getDiyUser(){
    return request({
        url: 'store.diyPage/getUser',
        method: 'GET'
    })
}

export function updateDiyUser(data:any) {
    return request({
        url: 'store.diyPage/updateUser',
        method: 'PUT',
        data
    })
}